package org.easy.liblibai.dto.enums;

import lombok.Getter;

@Getter
public enum LibLibGenerateStatus {
    WAITING(1, "等待执行"),
    PROCESSING(2, "执行中"),
    DONE(3, "已生图"),
    REVIEWING(4, "审核中"),
    SUCCESS(5, "成功"),
    FAILURE(6, "失败");

    private final int code;
    private final String description;

    LibLibGenerateStatus(int code, String description) {
        this.code = code;
        this.description = description;
    }

    public static LibLibGenerateStatus formCode(int code) {
        for (LibLibGenerateStatus status : LibLibGenerateStatus.values()) {
            if (status.getCode() == code) {
                return status;
            }
        }
        throw new IllegalArgumentException("No enum constant for code " + code);
    }
}
